package cn.edu.usst.cs.goldfish.booking.meetingroom.web.dto.booking;

import cn.edu.usst.cs.goldfish.booking.meetingroom.model.MeetingRoom;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class RoomWithSlotsResponse {
    private Long id;
    private String roomName;
    private Integer capacity;
    private String location;
    private String description;
    private String status;
    private List<Slot> freeSlots;
    
    public RoomWithSlotsResponse(MeetingRoom room, List<Slot> freeSlots) {
        this.id = room.getId();
        this.roomName = room.getRoomName();
        this.capacity = room.getCapacity();
        this.location = room.getLocation();
        this.description = room.getDescription();
        this.status = freeSlots.isEmpty() ? "occupied" : "available";
        this.freeSlots = freeSlots;
    }
} 